#ifndef tool_H
#define tool_H

#include <QObject>
#include <QMouseEvent>

class Document;

/**
 * The base class for all user tools that are used to interact with the document and its pages.
 */
class Tool : public QObject
{
    Q_OBJECT

public:
    /**
     * Creates a new empty tool which does nothing.
     * @param parent The parent QObject for this tool.
     */
    Tool(QObject *parent=0);

    /**
     * Return the current style-settings for the pen (width, color) for this tool.
     * TODO: Reflect the current style in the toolbar on tool-change.
     */
    QPen *currentPen() { return m_currentPen; }

    /**
     * Set the current pen style.
     */
    void setCurrentPen(QPen *pen);

private:
    /**
     * The current pen-style.
     */
    QPen *m_currentPen;

public slots:
    /**
     * Reacts to the mouse release event.
     *
     * @param event The corresponding QMouseEvent.
     * @param document The Document that send this event.
     */
    virtual void mouseReleaseEvent(QMouseEvent *event, Document *document);

    /**
     * Reacts to the mouse press event.
     *
     * @param event The corresponding QMouseEvent.
     * @param document The document that send this event.
     */
    virtual void mousePressEvent(QMouseEvent *event, Document *document);

    /**
     * Reacts to the mouse move event.
     *
     * @param event The corresponding QMouseEvent.
     * @param document The document that send this event.
     */
    virtual void mouseMoveEvent(QMouseEvent *event, Document *document);

    /**
     * Reacts to the mouse double click event.
     *
     * @param event The corresponding QMouseEvent.
     * @param document The document that send this event.
     */
    virtual void mouseDoubleClickEvent(QMouseEvent *event, Document *document);

    /**
     * Reacts to the tablet event.
     *
     * @param event The corresponding QTabletEvent.
     * @param document The document that send this event.
     */
    virtual void tabletEvent(QTabletEvent *event, Document *document);

};

#endif
